For a more mature implementation of this concept, I would highly recommend having a look at Kore: <a href="https://kore.io" rel="nofollow">https://kore.io</a><p>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.