moved api.py to server.py