modified api/index.php to work with php/lib.php