Rest router; bug fixes