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

...d from DB before registering the device.
rows[0] -> rows[DEFS.DEVICE_TYPE].length : More readable.