[api] yet another place of wrong registration mode "deny"

adding also some test cases.

Thanks to Rick Liu for reporting this.