updated code to contain web service pull logic