Refactor to add entity_xml and wait_for_running_tasks methods

Change-Id: I1632088c34bc823649115df0cb7ff445972b4849
cache name to avoid multiple request calls

Change-Id: Icacf9291672b991e15d21cbeb4c9c265b9c0843c