update error handeling with bad api return
Merge pull request #263 from teharrison/master

update error handeling with bad api return