api for single page application