cleanup + db session fixes (at the end of every call, session should be ...

...closed or committed