updated api.py to work with new refactored track class