[SOLVED] Return JSON on beforeFilter

I need to stop the execution on the beforeFilter method and render an error as a JSON.
I’ve tried using return $this->response without success.
What am I doing wrong? Thanks in advance.

SOLVED: the solution was using return $this->render();

This is my code:
image