Added index.php file and fixed errors in other .php files