Return valid JSON response in the API