Working on CouchDB implementation