api_ranks: move some stuff to Initialize()