Optimized the implementation of NSURLConnection and better error reporting.
Updated example.