Added error logging to the requests module