refer to environment variable and .netrc for api token
divide codes