Convert API to PHP-only