{"action":"closed","issue":{"url":"https://api.github.com/repos/sandisk/crunchbase-api/issues/4","labels_url":"https://api.github.com/repos/sandisk/crunchbase-api/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/sandisk/crunchbase-api/issues/4/comments","events_url":"https://api.github.com/repos/sandisk/crunchbase-api/issues/4/events","html_url":"https://github.com/sandisk/crunchbase-api/issues/4","id":56599747,"number":4,"title":"Crunchbase::Organization.find_all_by_query breaks if company name includes ampersand","user":{"login":"russorat","id":4805997,"avatar_url":"https://avatars.githubusercontent.com/u/4805997?v=3","gravatar_id":"","url":"https://api.github.com/users/russorat","html_url":"https://github.com/russorat","followers_url":"https://api.github.com/users/russorat/followers","following_url":"https://api.github.com/users/russorat/following{/other_user}","gists_url":"https://api.github.com/users/russorat/gists{/gist_id}","starred_url":"https://api.github.com/users/russorat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russorat/subscriptions","organizations_url":"https://api.github.com/users/russorat/orgs","repos_url":"https://api.github.com/users/russorat/repos","events_url":"https://api.github.com/users/russorat/events{/privacy}","received_events_url":"https://api.github.com/users/russorat/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-04T22:46:25Z","updated_at":"2015-05-04T21:12:36Z","closed_at":"2015-05-04T21:12:36Z","body":"Looks like the find_all_by_query function does not correctly handle the ampersand (&) symbol when encoding the url. Maybe try CGI::escape() instead of URI::escape() [here](https://github.com/sandisk/crunchbase-api/blob/master/lib/crunchbase-api.rb#L30)?\r\n\r\n```ruby\r\nCrunchbase::Organization.find_all_by_query('Ernst & Young LLP').first\r\nCrunchbase::CrunchbaseException: Failed to fetch https://api.crunchbase.com/v/2/organizations?query=Ernst%20&%20Young%20LLP&page=1&order=created_at%20desc&user_key=xxxxxxxxxxxxxx: Bad Encoding\r\n\tfrom /var/lib/gems/1.9.1/gems/crunchbase-api-0.2.1/lib/crunchbase-api.rb:41:in `rescue in fetch'\r\n\tfrom /var/lib/gems/1.9.1/gems/crunchbase-api-0.2.1/lib/crunchbase-api.rb:32:in `fetch'\r\n\tfrom /var/lib/gems/1.9.1/gems/crunchbase-api-0.2.1/lib/crunchbase-api/entity.rb:20:in `fetch_list'\r\n\tfrom /var/lib/gems/1.9.1/gems/crunchbase-api-0.2.1/lib/crunchbase-api/organization.rb:62:in `find_all_by_query'\r\n\tfrom (irb):20\r\n\tfrom /usr/bin/irb:12:in `<main>'\r\n```"}}