add authenticate func and finished backend application