add json serialization/deserialization and unit tests