updating example and adding ability to specify api key