updates to api.py and database.py, new index-api.wsgi