Split `api.py`