             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")
+            default:
+                try response.content.encode("Unknown Format: `lines` or `json` are acceptable formats")
+                response.http.status = .internalServerError
             }
             return response
         }

    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,
                         version: HTTPVersion(major: 1, minor: 0),
                         headers: HTTPHeaders([(HTTPHeaderName.contentDisposition.description, "attachment; filename=\"gitignore\"")]),
                         body: self.createTemplate(ignoreString: ignoreString))
        }
    }


    /// - Parameter ignoreString: Comma separated string of templates to generate
    ///
    /// - Peturns: Final formatted template with headers and footers
    private func createTemplate(ignoreString: String) -> (template: String, status: HTTPResponseStatus) {
        guard let urlDecoded = ignoreString.removingPercentEncoding else {
            return ("\n#!! ERROR: url decoding \(ignoreString) !#\n", .internalServerError)
        }
        var createStatus: HTTPResponseStatus = .ok
        let template = urlDecoded
            .lowercased()
            .components(separatedBy: ",")
            .uniqueElements
