simplejson added as requeriment
newuser argument added
Refactoring