Added basic validations, and fixed redirect bugs