refactor some tests and tweak the sessions controller
resolve merge conflict in sessions controller