Fix handling of executing apiQuery from tool to result zero results

@stephanfowler