moved dictionary code to dictionary.rb
refactored api call method