Fix api for whitelist hack

This PR fixes the whitelist for layer search when `topic` is `api`.