It works like this, because the consumers of the API are calling the functions correctly. We should probably make them more consistant, but this can be a headache (shell quotes escaping is hard). I'd rather look at this the next time I'm actually testing or extending this functionality.