Added perliminary support of API permissions
Added support for tokens on the REST API