Add error checking

Added a check for HTTP response code and throws an error for non success codes.  This will catch bad/missing API keys which was my main goal.

Also added a test case because me luv em tests.