Fixes #302 simplifies json decoding and handling of errors. Adds tests.
need to use ValueError to account for different json libraries throwing different exceptions
Merge pull request #308 from cash/add_error_tests

Fixes #302 simplifies json decoding and handling of errors. Adds tests.