Set up RESTful JSON API & Client

Both the web UI and the CLI should use the same API. Make a separate crate containing struct definitions for API inputs & outputs, as well as endpoint paths.