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