Fixing tests, better error handling

Hmm, it could prove useful if you were comparing against the documentation and had only used the API. Perhaps it should be a part of the new return object for errors.