public async Task <ActionResult> FetchPricesBySource([FromBody] Source source) { var response = await _priceService.GetBySourcesAsync(source); var priceItem = Mapper.ConvertJSONToCurrecyPair(response.Content.ReadAsStringAsync().Result, source); await _priceItemRepository.SavePriceItem(priceItem); //Validate if null if (priceItem == null) { return(NotFound()); //or any other error code accordingly. Bad request is a strong candidate also. } return(Ok(priceItem)); }