updated phpdoc
added json_encode for output