added code for getting the completed and incomplete task list in getTasks function