Update rapi encoders/decoders to work with buffers