properly handle error codes other than 200 from api server
Merge pull request #948 from berkshelf/handle-api-errors

properly handle error codes other than 200 from api server