added content negotiation for html and json