inlining response rendering to avoid eating the output if there is no error