api code generate, add a check for security