Added js method for adding participants into view.
Done some refactoring.