refactor account rest api