Changed connection control. Added auto-login. Now checks connectivity before each post/get