Fix for default/incorrect variant (xml/json) being returned
(cherry picked from commit 9f13650dda97cb381d472559e9fcf160325f873d)