refactor code between api parameters and info to avoid duplicate