Turn create into create or update based on device ID