moves API query params into main function