Using the API to get category_id by slug or name

The JS uses the information at /site.json for the list of “all categories that I’m allowed to know about”. (It’s just inserted into the HTML instead of requested at that URL.)