do not require an ending slash if /api/... is called. added an example as well