[api] Fixed a bug when accessing Ldap mode value