Adding Login/Logout endpoints to rest API.

Need tests.