changes to api.py