abstracted method on getting groups of servers for corresponding keys