Attempt to ensure that sessions are closed properly

Moved the session object to connections object

Change-Id: If86cce22db9cc8497736211c35ca73fd10186d6a