Implement token based authentication API