Separating frontend from backend with type safety - Nuxt