read api folder and create an endpoint