Added authenticate method and various other stuffs