Validate uniqueness of todo names
Extract todo-related ajax calls into a function