corrections on results controller and added logic on server