Added authentication (generating json web token) and protected some user routes.