Added handling for non-200 responses