Which version of axum are you using?
Starting from axum 0.8.0, the route syntax changes from /api/:id to /api/{id}.
/api/:id
/api/{id}