implemented full json serialization