updated to couchdb models