Update todos API and better error handling in client