stop fetching if result is empty

@mloudon 

related to https://github.com/dimagi/commcare-hq/pull/4354