Refactored for readability.
[#1] Replaced couch-client call with nano document insert call.
[#2] Added better error logging to an output port.