Rack middleware to throttle api requests