added :completed param to TaskController#create and removed duplicate code