Reorganize API code by grouped endpoints