Document the middleware API