added couchdb authentication and smoothed out startup process