Change aqe.php to use Cosm API