[api] fix several issues for ldap
[api] LDAP configuration clean up