api compatible with official protobuf