private async Task<ServiceEvent<AppInfo[]>> QueryApplications(string name = null)
{
if (!app.Initialized) throw new Exception("The application was not initialized.");
var resource = "publicapi/apps" + (string.IsNullOrWhiteSpace(name) ? "" : "?name=" + name);
var apps = await Url.Concat(resource).ExecuteAsync<JArray>(app, useToken: authentication.UseToken.None);
return apps.Clone<AppInfo[]>(apps
.Data
.Select(a => new AppInfo((JObject)a))
.ToArray());
}