How to structure a C project for a Rest-API/FastCGI Application Made For Lighttpd?

I'm setting up Rest-api/FastCGI on OpenWRT Router using C & Lighttpd. Where I would like to be able to call endpoints such as listing connected clients like http:127.0.0.1/router/clients .

I have the scripts to be able to carry out the actual actions I'm intending on implementing, however I'm struggling to find some sort of structure/idiom that I can follow to be able to connect lighttpd and effectively set up the appropriate routes.

I was given this repository that apparently was a starting point into this, and whilst some of it makes sense I can't put the pieces together and see how it actually works with Lighttpd : https://github.com/LancerSky/gl-demo

I know it's a slightly abstract thing to ask, but there must be some example &or way to show how i should structure my code in C and link it to Lighttpd.

Thanks!