pep8 compliance for api.py