updates to api.py