Implemented new logic for device token registration and retrieval.