code: @GetMapping(value = "/v1/dbs/{db}/save",
              produces = MediaType.TEXT_PLAIN_VALUE)
      @ResponseBody
      public final ResponseEntity<String> save(@PathVariable final String db,
              final HttpServletResponse response) {
          logger.info("Starting save");
          // check here whether authorized.
          try {
              final Root root = fetchRoot(db);
  
              final String contents = new GedWriter(root).writeString();
              final String filename = db + ".ged";
              logger.info("filename: " + filename);
              final HttpHeaders headers = new HttpHeaders();
              headers.setAccessControlExposeHeaders(
                      Collections.singletonList("Content-Disposition"));
              headers.set(
                      "Content-Disposition", "attachment; filename=" + filename);
              headers.setContentType(MediaType.TEXT_PLAIN);
              logger.info("Exiting save");
              return new ResponseEntity<>(contents, headers, HttpStatus.OK);
          } catch (DataSetNotFoundException e) {
              final HttpHeaders headers = new HttpHeaders();
              headers.setContentType(MediaType.TEXT_PLAIN);
              logger.info("Exiting save");
              return new ResponseEntity<>(
                      e.getMessage(), headers, HttpStatus.NOT_FOUND);
          }
      }
docs: Connects HTML template file with data for saving the GEDCOM file.
  
  @param db name of database for the lookup
  @param response the servlet response object, needed for tweaking headers
  @return a string identifying which HTML template to use.