Added xml format handling for api call.