Changed query to return a payload like the list function