add basic save/autosave functionality