Add redirects parameter to API request (handles redirects), fix PEP8 errors