add code to call rest APIs