Remove after block. Set outgoing content type to JSON.
Return JSON as a string.
Change mode on files.
Simplify get /api/searches.
Add catch-all bfore method for /api. Set content type.
Remove header for content-type: already set by before method.
Move cache params (search key, refresh timeout) to separate file.
Correct path for individual search before method.
No else block needed: always work with latest cached data.