add login method and ajax call from html