[api] Moved setup of AllowAnonymous to test_helper