I need to do a simple NSURLConnection when application goes in background or when ends.  

How can I do this ?  

I dont' need to download anything or to do any long time operations, I only need to call an API from web service.