Add a class "TemplateEngineNull". An instance of this engine is used if no template file for the current page is found.
This ensures that controllers accessing the new API variable do not run in null pointers.