code: @RequestMapping(value = "/pdf/{template}", method = RequestMethod.HEAD)
      public @ResponseBody DeferredState checkTemplate(@PathVariable String template) {
          DeferredState state = new DeferredState();
          TemplateListener listener = TemplateListener.templateListener(template,
                  test -> state.setResult(translateState(test)));
          templateListenables.forEach(l -> l.registerListener(listener));
          return state;
      }
docs: /*================================================================================================================
  ==============================================  State API controllers   =========================================
  =================================================================================================================