encode and decode for request and response