How can I implement advanced action routes (in routes.php)?
Yes it’s possible. First you will need to update your route key so that you’re capturing the name parameter with a valid named subpattern. (You were close, but missing the actual pattern part of it).

return array(
    'api/test/(?P&lt;name&gt;[^\/]+)' =&gt; ['action' =&gt; 'api/element/section'],
);


Any named subpattern matches in your route will be passed to your controller action’s $variables argument, if it has one.

class Api_ElementController extends BaseController
{
    // ...

    public function actionSection(array $variables = array())
    {
        $name = $variables['name'];

        // ...
    }
}


Note that you specifically need to call the argument “$variables”, and you need to typeset it to an array for this to work.