Fix new getdata bug with the search template

-index.php now checks if the file found can actually be used
-generate.php no longer uses json pretty print, because our servers are a little bit out of date and don't support this yet.