refining api processing