add pass_api_config method and refactored api codes.
Merge pull request #9 from hirakiuc/refactor_apis

add pass_api_config method and refactored api codes.