added support for to/from json