updated to use Protobuf encoding instead of JSON Encoding