login & register using new rest api