public async Task <ActionResult> Post([FromBody] CreateShortUrlViewModel vm) { if (ModelState.IsValid) { try { string url = await urlService.GetFinalLink(Request, vm.Url); return(Created(url, url)); } catch (Exception e) { logger.LogError(e.Message); return(BadRequest(e.Message)); } } return(BadRequest()); }