fixed bug in rest_url handling