Added authentication.
More API improvements.