fix syntax error on api.py patch