added support for json - not tested yet. need to test.