make the API work properly on empty result sets