The API_KEY is not inserted in the URL. In _uri, you need to access the
key named "TOKEN" (or change the interface to use "API_KEY"):
sub _uri {
my $self = shift;
my $meth = shift;
my %p = @_;
my $uri = URI->new(API_BASE . '/' . $meth . '/' . $self->{
API_VERSION });
$p{'api_key'} = $self->{ TOKEN }; # fix this line
$p{'outputtype'} = 'JSON';
$uri->query_form(%p);
return $uri;
}