Implemented task state change with ajax