Restructure frontend and backend parts, add API controller