refactored api use aws doc client