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

...d from DB before registering the device.
Check the status instead of the device_id here. Since relying on a status opcode from SP is better than the data itself.