fix REST api in 5 and add sql namespace