/// <summary>
        /// Gets status of the task (Running/Not running) and payload
        /// </summary>
        /// <param name="apiSession">api session</param>
        /// <param name="taskId">task guid</param>
        /// <param name="cancellationToken">cancellation token</param>
        /// <returns>Returns task status</returns>
        private async Task <RunningTaskStatus> GetRunningTaskStatusAsync(ApiSession apiSession, Guid taskId, CancellationToken cancellationToken)
        {
            if (apiSession == null)
            {
                throw new ArgumentNullException(nameof(apiSession));
            }

            var spaceName = apiSession.SpaceName;
            var nvc       = new NameValueCollection();

            nvc.Add("_", DateTime.Now.Ticks.ToString());
            var url = UrlHelper.JoinUrl("space", spaceName, "runningtasks", taskId.ToString("D")) + nvc.ToQueryString();

            using (var response = await GetHttpClient().SendAsync(BuildHttpRequestMessage(HttpMethod.Get, url, null, apiSession), cancellationToken))
            {
                var info = await HandleResponse <RunningTaskStatusDto>(response);

                return(RunningTaskStatusMapper.RunningTaskStatusFromDto(info));
            }
        }
        /// <summary>
        /// Start Task like "fire and forget"
        /// </summary>
        /// <param name="apiSession">api session</param>
        /// <param name="taskId">tast guid</param>
        /// <param name="cancellationToken"></param>
        /// <param name="taskParameters"></param>
        /// <returns></returns>
        public async Task <RunningTaskStatus> StartTaskAsync(ApiSession apiSession, Guid taskId, CancellationToken cancellationToken, IEnumerable <TaskParameterBase> taskParameters = null)
        {
            if (apiSession == null)
            {
                throw new ArgumentNullException(nameof(apiSession));
            }

            var spaceName = apiSession.SpaceName;
            var url       = UrlHelper.JoinUrl("space", spaceName, "runningtasks", taskId.ToString("D"), "payload");
            var dto       = new TaskStartRequestDto();

            if (taskParameters != null)
            {
                dto.TaskParameters = taskParameters.Select(TaskParameterMapper.ToDto).ToList();
            }
            var request = JsonSerializationHelper.SerializeAsStringContent(dto);

            using (var response = await GetHttpClient().SendAsync(BuildHttpRequestMessage(HttpMethod.Post, url, request, apiSession), cancellationToken))
            {
                var info = await HandleResponse <RunningTaskStatusDto>(response);

                return(RunningTaskStatusMapper.RunningTaskStatusFromDto(info));
            }
        }