implement a RESTful client in a declarative way