wip: Add rest api

Close #29
Implements #30 

TODO:

- [ ] put the application name in the service .name property
I see, I was looking at the `if(current) {...}else{}`.

I don't have a pref for one over the other, or think that one should always be used. If you already have functions, like here, or you factor each case statement into a single function, then doing it like it is here makes sense to me.

If its not worth factoring every case statement into a function, then I use a switch and blocks, like in option parsing.

When to use a case vs. a series of if-else, when to factor a block into a function, these are all judgement calls. In this case, a switch would be much more code, this is easily readable in a single line.