added api.py

added api.py