small change to json wrapper to allow custom classes to be returned and
serialized