Removed redundant code from rest.php