refactor and fix accounts api spec