Fix api routing from namespace to scope

The /api routing was broken in a recent pull request - this restores it.