changed to use API PUT; fixed for jshint;