         }
     }
 
-//    /// Remove a publication from the server.
-//    ///
-//    /// - Parameter endpoint: The PublicationIdentifier of the Publication to remove.
-//    public func remove(publicationIdentifier: String) {
-//        var keyToRemove: String? = nil
-//
-//        // Find the publication key in pubBoxes.
-//        for pubBoxe in pubBoxes {
-//            if pubBoxe.value.publication.metadata.identifier == publicationIdentifier {
-//                keyToRemove = pubBoxe.key
-//                break
-//            }
-//        }
-//        // Remove the publication from the publicationServer served publications.
-//        if keyToRemove != nil {
-//            remove(at: keyToRemove!)
-//        }
-//    }
-
     /// Remove a publication from the server.
     ///
     /// - Parameter endpoint: The URI postfix of the ressource.

            request: GCDWebServerRequest.self,
            processBlock: manifestHandler)

        // FIXME: Add the handler for the resources OPTIONS
        //         webServer.addHandler(
        //         forMethod: "OPTIONS",
        //         pathRegex: "/\(endpoint)/.*",
        //         request: GCDWebServerRequest.self,
        //         processBlock: { request in
        //
        //         guard let path = request?.path else {
        //         Log.error?.message("no path in options request")
        //         return GCDWebServerErrorResponse(statusCode: 500)
        //         }
        //
        //         Log.debug?.message("options request \(path)")
        //
        //         return GCDWebServerDataResponse()
        //         })

        log(level: .info, "Publication at \(endpoint) has been successfully added.")
    }

    public func remove(_ publication: Publication) {

                log(level: .error, "The request received is nil.")
                return GCDWebServerErrorResponse(statusCode: 500)
            }
            //            guard let path = request.path else {
            //                log(level: .error, "The request's path to the ressource is empty.")
            //                return GCDWebServerErrorResponse(statusCode: 500)
            //            }
            // Remove the prefix from the URI.
            let relativePath = request.path.substring(from: request.path.index(endpoint.endIndex, offsetBy: 2))
            let resource = publication.resource(withRelativePath: relativePath)
