```php
<?php

require_once '../../core/api_bootstrap.php';
require_once '../../core/employee_auth.php';

EmployeeAuth::check('manage_roles');

$data = Request::post();

try{

Validator::required($data,['id','name']);

$db = new Database();
$conn = $db->connect();

$stmt = $conn->prepare("

UPDATE roles
SET name=:name,
description=:description
WHERE id=:id

");

$stmt->execute([
':id'=>$data['id'],
':name'=>$data['name'],
':description'=>$data['description'] ?? null
]);

Response::success([],"Role updated");

}
catch(Exception $e){

Logger::log("system.log",$e->getMessage());

Response::error("Server error",500);

}