issue #28: implemented JSON serialization