rest controller bug fix, fix tests