set correct content type on xml requests

introduced functions for expecting a specific content type (implemented
only for json and xml now)