device registration and deletion fully working with DB