XenForo 2.2.8 adds a new empty
\XF\Api\Templaterclass, which directly extends the base
\XF\Template\Templaterclass. If you have any class extensions on
\XF\Template\Templaterthat you expect to apply within the REST API you'll have to duplicate them, or split out your custom parts into a trait that gets included on both and call that trait's function from within your extended methods.