added 404 handling for /api/