code refactored and mongo db support, server starts on test environment when mocha test runs