Move home page functionality into a seperate action file;
Fix a little problem in form validation.