added some additional error checks. added option to turn off sessions. added req.isJson() method. added some logic to handle 404 errors for json requests