Added connection checking to channel related API calls.
Silenced fwrite errors (should be handled when calling send_data).