Updated to work with api v3.