FIX Restcontroller

The rest controller and the test are fixed.