Added proper reference to api_key in the constructor.

Instead of accessing the local variable, it's better to access the global one because we already set it in the previous statement.