Add couchdb-backend

Fix error in memory backend and and couchdb-backend