refactored crud logic to couchDbService