fixed rewrite to app.php for API