json API for P language