title: when using google directions Api and requesting data in json getting nil data
body: <p>I am new to programming and ios development with swift. I am trying to map a route between two locations and have encountered this problem.</p>
  
  <pre><code>func getDirections(origin: String!, destination: String!, waypoints: Array&lt;String&gt;!, travelMode: AnyObject!, completionHandler: ((status: String, success: Bool) -&gt; Void)) {
      if let originLocation = origin {
          if let destinationLocation = destination {
              var directionsURLString = baseURLDirections + "origin=" + originLocation + "&amp;destination=" + destinationLocation
  
              directionsURLString = directionsURLString.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)!
  
              let directionsURL = NSURL(string: directionsURLString)
  
              dispatch_async(dispatch_get_main_queue(), { () -&gt; Void in
                  let directionsData = NSData(contentsOfURL: directionsURL!)
  
                  println(directionsData)
  
                  var error: NSError?
                  let dictionary: Dictionary&lt;NSObject, AnyObject&gt; = NSJSONSerialization.JSONObjectWithData(directionsData!, options: NSJSONReadingOptions.MutableContainers, error: &amp;error) as! Dictionary&lt;NSObject, AnyObject&gt;
  </code></pre>
  
  <p>I am getting the error: </p>
  
  <blockquote>
    <p>fatal error: unexpectedly found nil while unwrapping an Optional value</p>
  </blockquote>
  
  <p>I tried printing the data which I was receiving and it comes out nil</p>
  
  <pre><code>let baseURLDirections = "https://maps.googleapis.com/maps/api/directios/json?"
  </code></pre>