Properly handling http content negotiation