fixing persistence + json serialization + tests