Implemented efficient api for rankings.