Changed errors to use sessions instead

- Added logic for sessions
- Added error helper method