refactor API structure, very clean