fixes error:
Using $this when not in object context in Rest.php on line 412