add code to check call rest or soap