      disallow any requests from other domains, or set to '*' to allow from any domain. */
     public init(agent: SQLAgent, router: Router, allowCorsOrigin: String?) {
 		self.agent = agent
-        
-        let mw = SQLAPIEndpointCORS(allowOrigin: allowCorsOrigin)
-        router.options("/api/*", middleware: mw)
-        router.get("/api/*", middleware: mw)
-        router.post("/api/*", middleware: mw)
-    
+
+		// API used by the web client
+		let mw = SQLAPIEndpointCORS(allowOrigin: allowCorsOrigin)
+		router.options("/api/*", middleware: mw)
+		router.get("/api/*", middleware: mw)
+		router.post("/api/*", middleware: mw)
 		router.get("/api", handler: self.handleIndex)
-		router.get("/api/block/:hash", handler: self.handleGetBlock)
-		router.get("/api/head", handler: self.handleGetLast)
-		router.get("/api/journal", handler: self.handleGetJournal)
-		router.get("/api/pool", handler: self.handleGetPool)
-		router.get("/api/users", handler: self.handleGetUsers)
+		router.get("/api/counter/:hash", handler: self.handleGetCounter)
         router.post("/api/query", handler: self.handleQuery)
+
+		// Debug APIs
+		router.get("/debug/block/:hash", handler: self.handleGetBlock)
+		router.get("/debug/head", handler: self.handleGetLast)
+		router.get("/debug/journal", handler: self.handleGetJournal)
+		router.get("/debug/pool", handler: self.handleGetPool)
+		router.get("/debug/users", handler: self.handleGetUsers)
         
         router.all("/", middleware: StaticFileServer(path: "./Resources"))
 	}

		}

		response.send(json: [
			"status": "ok",
			"blocks": data
		])
		next()

		let pool = self.agent.node.miner.block?.payload.transactions.map { return $0.json } ?? []

		response.send(json: [
			"pool": pool
		])
		next()
