<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_middleware(self, middleware):
 """Adds a middleware object used to process all incoming requests against the API"""

        if self.middleware is None:
            self._middleware = []
        self.middleware.append(middleware)