fixed linking and added error handling for protect=true if api already registered
fixed linking and added error handling for protect=true if api already registered

ameily/raziel,ameily/raziel,ameily/raziel