refactoring couchDbHandler into service. In progress of creating authentication service