rest service class for PHP