perfected login logout rest api