Updated code to reflect new REST endpoint