update rest to 3.0 and fix code