Workflow basic api

Create the basic workflow API. Can @ascandaroli and @pfracarolli take a quick look? It has problems, I just want to make sure I find all problems and create issues for them.
Need to differ from a 404 or 400.
Also could be a system error, not related to the user, hence not a 4xx error but a 500 error of some sort.