Error handling in client logic
Added logging utilities
More debug logging