improved RestUtils register and remove resources