add login support and api/writting support