[api2] Fix bugs for varaible name and function conficts