added method to add a new task to the todoList on the client-side