Add basic rest functions with sql queries