Add API to check if login is valid.