Added doc for middleware