deprecating use of templates.setGlobal on server side in favour of passing in api.config into res.locals (still needs work)