Added content negotiation to rendering of errors.