added handling for invalid word search
added api_key error handling