Errorhandling

Added error handling for all network calls.