title: My session.dataTaskWithRequest method is not returning any data
body: <p>I need to interrogate our Api to populate our main screen, so I set up a separate class called <code>RestApiManager</code> and added the code below:</p>
  
  <pre><code>import UIKit
  
  class RestApiManager: NSObject {
     static let sharedInstance = RestApiManager()
  
     let baseURL = "http://api.randomuser.me/"
  
     func getData() {
        let request = NSMutableURLRequest(URL: NSURL(string: baseURL)!)
        let session = NSURLSession.sharedSession()
  
        let task = session.dataTaskWithRequest(request, completionHandler: {data, response, error -&gt; Void in
          if data != nil {
              do {
                  let json = try NSJSONSerialization.JSONObjectWithData(data!, options: .MutableLeaves) as? NSDictionary      //:JSON = JSON(data: jsonData)
              }catch _ as NSError
              {
              }
          } 
      })
      task.resume()
     }
  }
  </code></pre>
  
  <p>I used the url shown as a simple test, as I know it returns data without any properties as i tested it in my browser but each time I run my app the data is always nil.</p>
  
  <p>What am I doing wrong?</p>