saves stats in JSON