added support for json serialization.