Cleaned up api code to match pep8 style guide
Cleaned up download code for pep8