Adding LDAP auth, resolving bugs, new architecture and apis