Developing an API beside LuCi

Is it possible to develop an API beside LuCi and passing some parameteres using GET method? Something like this:

https://192.168.1.1/agent.php?gpio1=on&gpio2=off

I must say that due to low hardware resources like my flash size, I can not use web servers like apache and I can not use PHP for backend development. I think I must use something like uhttpd and lua for backend development. The thing is I do not know if I chose the right way or not and also I don't have any ideas of how to do this.

Thanks in advance

there's LuCI rewrite in ucode - testers wanted, it might affect your road map.