Refactoring of Rest controller

Fixed #287 
Updated requirements (for PHPUnit)