Moved controller logic from jsp to NimController.