 
   // Test closure
   let closure = { (request: RouterRequest, response: RouterResponse, next: () -> Void) -> Void in
-    response.setHeader("Content-Type", value: "text/plain; charset=utf-8")
+    response.headers.append("Content-Type", value: "text/plain; charset=utf-8")
     do {
       try response.status(HTTPStatusCode.OK).send("Hello World, from BluePic-Server! Original URL: \(request.originalUrl)").end()
     }

              Log.error("Failed to send response to client.")
              response.error = generateInternalError()
            }
          } else {
            response.error = generateInternalError()
          }
          next()
        }
    }
  }



  // Get all image documents
  router.get("/images") { request, response, next in
    if let tag = request.queryParams["tag"] {
        let _ = tag.characters.split(separator: ",").map(String.init)
        // Get images by tag

        let queryParams: [Database.QueryParameters] =
        [.descending(false), .includeDocs(true), .reduce(false), .endKey(["label", 0]), .startKey(["label", NSObject()])]
        database.queryByView("images_by_tags", ofDesign: "main_design", usingParameters: queryParams) { (document, error) in
          if let document = document where error == nil {





            do {
              let images = try parseImages(document: document)
              try response.status(HTTPStatusCode.OK).send(json: images).end()
