Restfull api

Adding Restfull API to get a ticket, and validate it. Adding logout.