Updated controller and js for delete requests