Adding new function getWebServiceData to clean up error handling.