Python code for a Hangman game, incorporating API Functionality