Refactor check helper functions of API arguments.