Rack middleware to extract API versions