save all data to database