#261 was created before the introduction of the linter, therefore it wasn't approved by it. This commit fixes all the introduced linter violations.
client errors are now returned as an 'error', API errors as APIResponse.