bugfixed plugin api hooks