db: add state to MarkFinished
server: add interaction with gearman