Add debug option
Rename api.py to core.py