Responding to T321592, this MR adds a check to return a 404 in the case of a successful query and returned empty dataset.