example of using a REST api in scala