Move encoding to response section