Fixing errors returned by the API