Make mongo and session optional