Remove use of deprecated api calls