Testing for API in NextJS