APIs will definitely help you in such cases. I suggest you to familiarize yourself with the current source documentation as it also tells you where certain methods are defined.
public function rules()
{
return array(
// username and password are required
array('username, password', 'required'),
// password needs to be authenticated
array('password', 'authenticate'),
);
}