Add logic for APIHook.cpp