updated api method to get the rank