Switch from json_response function to class for responses.