Added log-in validation & hooked API.