Fixed issues with functionality of client, added authentication