nitrestful: intercept at `prepare_respond_and_close` instead