Replace bytestring in api

Gets rid of the protobuf exposure outside of the core