Corrections Rest.php

See issue#24. Thank you, huschi-jan!