passing api key to the main function