Rest request handler