update error handeling with bad api return