Error handling

I've added some error handling that may be helpful to some.  Handling of timeouts, bad responses, and bad requests.