public async Task <IHttpActionResult> CreateClient([FromBody] ClientBindingModel clientModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var newClient = await _refreshTokenManager.AddClientAsync(clientModel); if (newClient != null) { return(Ok(_factory.Create(newClient))); } ModelState.AddModelError("", $"Client: '{clientModel.Name}' could not be added to clients."); return(BadRequest(ModelState)); }