Separated filemanager REST API into PHP class and Restful controller, closes #155