CMS-1560 Import creating temporary duplicates which are removed later

Added "returnAll" flag for queries