added functionality to save ledgers to couchdb