this adds snpashoting of history and save to json functionality