public ActionResult Authorize([FromBody] ExistingKeyRequest body) { var key = body.Key; if (!_authService.IsKeyValid(key)) { throw new Exception("Access key is invalid"); } if (!_databaseClient.ContainsKey(key)) { _databaseClient.AddClient(key); } return(Ok()); }