added exception handling for the device curl call.