async function getPlayerCounts(range) { const res = await fetch(`/api/player-count?range=${range}`) if (!res.ok) { throw new Error(`Failed to get player counts, got status ${res.status}`) } const json = await res.json() return json }