Added content negotiation for application/json and text/html