Properly close connection for Google API query