Use json_ensure_response instead of reinventing