We can probably make an internal utility function that consolidates the logic for the global and tenant end point. Have a look at @mrvisser 's recent UserVoice PR for an example