Add getStatesArray method with cache