add getprimary and getreseller functions