calling rest api from spark