implemented parts of the channel pipeline to encode commands and decode
responses