refining api integration