add comments to api.py, get print out of function