API key check moved to main function so it's called after say is defined