Asynchronous API calls with delegates and event handlers I'm making a WindowsPhone 8 app in C#. With this an API so I can convert JSON data into useful objects. I've found a method but am wondering if it is any good at all.
The problem is it's been a while since I've really worked with C# and never for windows phone. 

Because it's making use of web requests it has to be asynchronous. From somewhere User.getTracks() should be called and handled. To do this I've come up with a solution but I don't know if it's a good one. 

I have an ApiCaller class which has a few different ApiAction methods, these methods receive a generic to know what type to eventually serialize to. The main method receives all the data, makes the web request and serializes the JSON to an object. 

public static async void ApiAction&lt;T&gt;(Uri uri, CallExecuted cbDelegate, HttpMethod method, bool requireAuthentication)


Here it receives a CallExecuted this is the delegate from the calling class. After serializing the JSON data it calls this delegate with the item as parameter cbDelegate(new CallbackArgs(item));

The calling class will have the following to process everything 

    public delegate void GetTracksExecuted(List&lt;Track&gt; tracks); // The delegate other classes use
    public static event GetTracksExecuted tracksExecuted; // The local event that calls the above delegate

    // This is called from elsewhere 
    // The parameter is the delegate from that class
    public void GetTracks(GetTracksExecuted e)
    {
        tracksExecuted += e;
        ApiCaller.ApiAction&lt;List&lt;Track&gt;&gt;(ApiCall.UserTracks, TracksDelegate, Id);
    }

    // The delegate given to ApiCall class
    public delegate void CallExecuted(CallbackArgs e);

    // The delegate that is called from the ApiCall class (CallExecuted)
    private static void TracksDelegate(CallbackArgs args)
    {
        List&lt;Track&gt; tracks = (List&lt;Track&gt;) args.Item;
        tracksExecuted(tracks);
    }


Is there a better way to accomplish any of this? Was thinking about just using the event to do it, leaving the delegate out, but don't know if that's better. Your input is very welcome
public static async void ApiAction&lt;T&gt;(Uri uri, CallExecuted cbDelegate, HttpMethod method, bool requireAuthentication) Here it

  
  receives a CallExecuted this is the delegate from the calling class.
  After serializing the JSON data it calls this delegate with the item
  as parameter cbDelegate(new CallbackArgs(item));


I think you should learn how to use async-await properly. Instead of using async void (which is a bad practice in general) and taking a delegate, your method should return something like Task&lt;List&lt;Track&gt;&gt;.

This way, your method would look like this:

public Task&lt;List&lt;Track&gt;&gt; GetTracksAsync()
{
    return ApiCaller.ApiAction&lt;List&lt;Track&gt;&gt;(ApiCall.UserTracks, Id);
}


You wouldn't need all the boilerplate around it and you would also handle exceptions properly.

To use GetTracksAsync(), you would then use await:

List&lt;Track&gt; tracks = await GetTracksAsync();