serve path function