Better handling of failing api requests