Added prot query method to model
json_encode_* automatically manages output buffers