[nr] almost got rid of create workspace in api (reduce to one place so we can...

... handle codes directly).