Bugfix on api/index.php