Added save and load to JavaScript API