wip: Add rest api

Close #29
Implements #30 
This should probably be `[ ... ].join('/')` so this doesn't generate strange URLs if run on Windows.