REQUEST_URI will always be the original path of the request. You should be using PATH_INFO instead in your PHP script if you want the path as rewritten by the server.
You can replace this with handle_path /api/*, which is a shortcut for handle + uri strip_prefix.
‘REQUEST_URI’
The URI which was given in order to access this page; for instance, ‘/index.html’.
‘PATH_INFO’
Contains any client-provided pathname information trailing the actual script filename but preceding the query string, if available. For instance, if the current script was accessed via the URL http://www.example.com/php/path_info.php/some/stuff?foo=bar, then $_SERVER[‘PATH_INFO’] would contain /some/stuff.
Yeah this is a bug in the syntax highlighter that I wrote. I implemented the syntax highlighting lexer before handle_path existed and I haven’t spent the time going back to fix it yet. Sorry about the confusion there.