Next api server handling requests