add some exception handling for accessing resources from the server
add more exception handling; catch connection exceptions