updated api to cache attrs by principal id