move save functionality into ui/save.js