Trim whitespace and newlines. Print debug log only if API_KEY can be found in env path