wip: Add rest api

Close #29
Implements #30 
What is this code for? All I see is a bunch of undefined references...