create api route and parse request as json