handle xapi version in req and res