<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def createURL(self, word, mode="phonefy"):
 """ Method to create the URL replacing the word in the appropriate URL. Args: ----- word: Word to be searched. mode: Mode to be executed. Return: ------- The URL to be queried. """

        try:
            return self.modes[mode]["url"].format(placeholder=urllib.pathname2url(word))
        except:
            if mode == "base":
                if word[0] == "/":
                    return self.baseURL+word[1:], word
                else:
                    return self.baseURL+word
            else:
                try:
                    return self.url[mode].replace("<"+mode+">", urllib.pathname2url(word))
                except:
                    pass
        return None