Rework API for menus, refactor the backend to prepare for nested menus