Fix a regression that caused API job to return prematurely.