removed broad exception catch to specific catch for requests, some formating of the code to better comply with pep-8