Fixed a few declarations and changed API used for authentication.