move Encode/Decode to response and request packages