title: Nested nsurl dataTaskWithRequest but after the completion handler called
body: <p>I have this part of code and it was work with &quot;NSURLConnection sendSynchronousRequest&quot; and they was having a dispatch and have the both API call in it with no issues, however since i am moving to &quot;NSURLSession&quot; and i would to call the next API after the first one response inside the completionHandler, do i need tho add any type of dispatches for the second API call?</p>
  <pre><code>//    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch was here
  
      __block NSString* url = @&quot;www.google.com&quot;;
      [[LoaderService get] getRequestFrom:url completionHandler:^(TcHttpJSONResponse *response) { // first Call
          if (!response.success) {
              dispatch_async(dispatch_get_main_queue(), ^{
                  failBlock();
              });
              return;
          }
          
          url = [NSString stringWithFormat:@&quot;www.google.com/drive&quot;];
          [[LoaderService get] getRequestFrom:url completionHandler:^(TcHttpJSONResponse *response) { // second Call
              if (!response.success) {
                  dispatch_async(dispatch_get_main_queue(), ^{
                      failBlock();
                  });
                  return;
              }
              dispatch_async(dispatch_get_main_queue(), ^{
                  successBlock(transactionsArray);
              });
          }];
      }];
  //    }]; //end of dispatch
  </code></pre>
  <p>in LoaderService</p>
  <pre><code>- (void)getRequestFrom:(NSString *)url completionHandler:(void (^)(TcHttpJSONResponse *response))completionHandler {
      NSURLSession *session = [NSURLSession sharedSession];
      [[session dataTaskWithRequest:[TcHttpHelper getRequestFromUrlWithAuthorizationToken:url token:[self getAuthToken]]
              completionHandler:^(NSData *data, NSURLResponse *response,  NSError *error) {
          completionHandler([[TcHttpJSONResponse alloc] initWithResponse:data urlResponse:(NSHTTPURLResponse*)response error:error]);
      }] resume];
  }
  </code></pre>