Update ajax.class.php and main

Add custom action index and a default function