Fix error in memory-backend and add couchdb-backend