Fix API stop after error.