example of using rest API