Make delete API work more reliable