Fix API query results bug