JSON API: use self instead of $this

It caused multiple syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM errors on sites running PHP 5.2

cc @lezama @roccotripaldi