save/restore as json