Respond to API requests with JSON, not strings