Added better validation server-side and added Underscore.js functions.