Modularize app API code