Added authentication

Minor style change, some JS too