Clean up API router, return proper HTTP status