Api related

Fixed merge issues with develop, added register device logic.