Added api key function