Fixed client js with respect to hard-coded API endpoints and those with the {id} variable somewhere in the middle.