Still working on API and db related stuff

* session concurrency has been improved
* lot of db structure related fixes has been done
Still working on API and db related stuff

* session timeout logic have been partly covered by unit-tests
* testability of code has been improved