changed routes. added validation. cleaned up formatting