a REST client in PHP and Javascript