Encode response depending on Accept header. supports: application/json