Added register, login, logout functions