bindings for the json export.
+ unit test (incomplete).