implement json serialization (dump, but not load)