Send JSON responses on API requests.