How to work with APIs in Ruby