further fixes to rest_proxy.php

h/t to Travis at marketcake.com