json serialization and deserialization for REST service