API: GET /api/count?text=... or POST /api/count with {"text": "..."}
GET /api/count?text=...
POST /api/count
{"text": "..."}