refactor($http): simplify buildUrl function