wip: Add rest api

Close #29
Implements #30 
'close' has an arg, if 'finish' has an arg, it will treated as an error...
the docs claim it does not, so I'll trust in them.

​