It seems like this code (and others) could use a helper class to build urls. Perhaps call it ApiUrlBuilder or something like that?