use task_root global variable, move json writing into single function
CompleteTask uses WriteJson()
add json file if it doesn't exist