code: def _prepare_controller(self, controller, template):
          
          if template:
              fn = aiohttp_jinja2.template(template_name=template)(controller)
          else:
              fn = self._parse_json_response(controller)
          return fn
docs: Wraps the controller wether to render a jinja template or to return a json response (if template is None)
          Args:
              controller (coroutine): the coroutine to be wrapped
              template (str): the name of the template or None
  
          Returns:
              coroutine: a wrapped coroutine of the controller