New API for jobDone and jobFail