Added NSURLSession code.
Neatened up code in NSURLSession.