cleaning residues after API