fixing bad query passed to server
additional debug information for login
adding in what's needed to see if user is logged in