split server code into modules and added consultation treatment view