Move todo list resource to factory, use promise in todo