     internal func createTemplateDownloadEndpoint(router: Router) {
         router.get("/api/f", String.parameter) { request -> HTTPResponse in
             let ignoreString = try request.parameters.next(String.self)
-            return HTTPResponse(status: .ok,
+            let (template, status) = self.createTemplate(ignoreString: ignoreString)
+            return HTTPResponse(status: status,
                          version: HTTPVersion(major: 1, minor: 0),
                          headers: HTTPHeaders([(HTTPHeaderName.contentDisposition.description, "attachment; filename=\"gitignore\"")]),
-                         body: self.createTemplate(ignoreString: ignoreString))
+                         body: template)
         }
     }
 

        router.get("/api", String.parameter) { request -> Response in
            let response = request.makeResponse()
            let ignoreString = try request.parameters.next(String.self)
            try response.content.encode(self.createTemplate(ignoreString: ignoreString))
            return response
        }
    }

            switch format {
            case "lines": try response.content.encode(templateKeys.joined(separator: "\n"))
            case "json": try response.content.encode(json: self.templates)
            default:
                try response.content.encode("Unknown Format: `lines` or `json` are acceptable formats")
                response.http.status = .internalServerError
            }
            return response
        }
