Abstracting database layer, device registration
light apis fixes