[code] split index.php in api and setup_doctrine