how to call rest api from spark scala