added checks for workspace id existence and fixed retrieve calls
added checks for workspaceId existence