Updated to work with version 2.0 of API