A new method save_data which handles the needed actions is order to save the data. Tests for the new method added too.