Implement sessions and mongodb

Implement sessions and mongodb