Make sure that a faulty api call end after error