Routine for content negotiation