Better ajax implementation to mark task as done