Fix HTTP error handling
Merge pull request #43 from skinnyfit/master

Fix error handling