added a little SQL to the api.py