added logic for create, edit and filter todos