Further improvements to error handling in thing.tasks.APITask