Fixed pep8 issues in the api code