Check return value from api

How do i check the return value from this API or in other words how do i test it if its working?

Because when i try to click on this link <a href="?module=API&method=AnotherPlugin.getAnswerToLife">Link</a> , i can’t see a response. Please guide on how to check custom apis

       namespace Piwik\Plugins\AnotherPlugin;
    use Piwik\DataTable;
    use Piwik\DataTable\Row;
    class API extends \Piwik\Plugin\API
        public function getAnswerToLife($truth = true)
            echo 'hola';
            if ($truth) {
                return 42;

            return 24;