fixing changes in api

api changed fixing code to account for depreciated functions