public HttpStatusCode deleteTempHistoricalData(string id) // convert to json { var response = new HttpResponseMessage(); HttpStatusCode res; try { string _id = JsonSerializer.Deserialize <int>(id).ToString(); bool idExists = _stockScreenerService.TempIdExists(_id); if (idExists) { _stockScreenerService.RemoveTempHistoricalId(_id); } else { return(HttpStatusCode.Ambiguous); } res = response.StatusCode; } catch (Exception ex) { if (ex is System.ArgumentNullException) { Console.WriteLine("Exception " + ex); } Console.WriteLine("Exception " + ex); res = response.StatusCode; } return(res); }