<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _ensure_started(self):
 """Marks the API as started and runs all startup handlers"""

        if not self.started:
            async_handlers = [startup_handler for startup_handler in self.startup_handlers if
                              introspect.is_coroutine(startup_handler)]
            if async_handlers:
                loop = asyncio.get_event_loop()
                loop.run_until_complete(asyncio.gather(*[handler(self) for handler in async_handlers], loop=loop))
            for startup_handler in self.startup_handlers:
                if not startup_handler in async_handlers:
                    startup_handler(self)