add fn for saving analyses to the db