port to php-lib-rest