Core dump when getting the task store
Move out some of the JSON logic.