Bug-quenching for set_state and courseadd

Fixed and rewrote the callback-function in js for adding courses to a
user