Added debug output to post-rest.php