definition of buildUrl function to encourage DRY.

The function is being called from the two methods (get and getAtTime).
TBD: do the same to request.get method.