Updated client side code

Added login function