cleaned up middleware
automatic json and xml parsing