moved server call to the resolve block