Allow api to return json or xml responses.