fix fetch error message from restapi
remove device association before deleting it