Where are you storing
%servers and
%names? It doesn't magically exist all the time. You should probably store it on the HTTPObject itself (changing
%servers to
%this.servers and doing the same for
%names) and also empty those variables upon starting a new query.
Secondly, this will create an empty server in the start of the list. You might want to start the field loop at 1 instead of 0 to skip it. It isn't that much of a problem because "" won't be checked (start of
getServerByName), but it's still a detail.