Authentication thru API

It closes #13 and closes #14.