Change error code in API from 404 to 400.
Generalize handling of API requests.
Add support for listing workspaces.

* api.js now supports a listws action
* mist-gui-workspaceFunctions.js now has a listWorkspaces method
Add API for deleting workspaces.