```php
<?php

require_once '../../core/api_bootstrap.php';
require_once '../../core/employee_auth.php';
EmployeeAuth::check('view_analytics');
try {

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

$query="

SELECT

source_page,
COUNT(id) AS total_leads

FROM customer_leads

WHERE source_page IS NOT NULL

GROUP BY source_page

ORDER BY total_leads DESC

LIMIT 20

";

$stmt = $conn->prepare($query);
$stmt->execute();

$data = $stmt->fetchAll();

Response::success($data);

}
catch(Exception $e){

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

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

}