New api rest_logout for logout without html