split api and frontend