Add Rack middleware