adding couchdb ajax functions