Fixed issues in device management APIs