Added check for negative sessions
Restoring amount of connections
Added mongodb formatted log output