DEvice defines API and service call added. Now device defines are fetche...

...d from DB before registering the device.
Log the device id along with the reason in order to make more sense of which device we added/already existed.