Pass only an Api instance to the middleware, not methodPathPattern