working on the couchdb stuff