Options -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^api/?(.*)$ api/index.php [QSA,L]
