For a more mature implementation of this concept, I would highly recommend having a look at Kore: https://kore.io
It has a sane architecture, and is fully privilege separated by default, with private keys isolated in a separate process. I've been using it lately to write REST APIs in C, and the experience has been awesome, it has great APIs to parse requests and easily construct responses.
Yes, but for very obvious reasons not in this thread. The most abbreviated version of that story would be: I indirectly owe Chuck Forsberg all of my wealth.