documented all steps for api call