REST set jobs state function
REST finished state