guard `add` and `get` (and composites like `replace`) from invalid
json