completed implementation of create or update couchDb document.