refactored session api to use terms 'unit of work' rather than transaction