APY-34 : Refactor encoder

FInalized the reponse encoder refactoring.