Added few missing js dependencies.
Implemented security mechanism which more or less works ok.