URLs in angular

I have a controller that has an http.get function in it that looks like this:

$http.get('api/population_data', {cache: true}).success(function(data) {
$rootScope.population_data = data;
});

I am currently in the middle of refactoring my code to put http requests in a service, then call the appropriate function from the service in the controller (makes the app more testable, and follows better design practices):

DashboardHTTPService.get_population_data().then(
function(response) {
$rootScope.population_data = response;
});

My issue is that when I make the .get_population_data call, the service no longer resolves the full url in the http.get request: What I'm trying to say is, when I had the http.get request in my dashboard controller, I could make the request from there and it would know to navigate to my api url '/dashboard/4/api/population_data', but when I make the http.get() from the function in the service it just looks for /api/population_data (does not prepend the /dashboard/4 like before).

I think there is something about url resolution in the context of the controller that I am missing...can someone explain why this is? I'm thinking I can have the controller pass in the location.pathname to the service, but I don't think that is the best solution...

Thanks, sorry for being a bit confused, but I didn't think that any of the other questions I looked at answered my question appropirately..