Added routes for login, logout, register and a middleware for all other requests