Better error reporting in API Client