json_error_response helper method