generic REST server