Don't raise, return json errors for detected (expected) errors.
Got a message that the dict was changing in the loop, so avoid referencing `iteritems`
Prefix the `node_type` on both get and set, and overall make more robust.