trashing api side introduces some hassles so do it client side instead