DNN-5324 refactor tags logic so encoding occurs at the API level and not control level