code cleanups
some logging
db fixed for mongolab