require(['api']).api.get() targets NodeBB's v3 write API and 404s on /api/v3/unread. Use a plain fetch against the read route /api/unread instead.