update documentation for middleware