Fix error handling when the API returns just a plain string instead of a hash

In addition to handling validation-errors, this should also handle the case when the API responds with errors like `{'errors':'some error'}`