added code snippet for network call