Update index.php

According to a comment on http://coenraets.org/blog/2011/12/restful-services-with-jquery-php-and-the-slim-framework/ this has a XSS-hole pattern: 
----------
line 25:
echo ‘{“error”:{“text”:’. $e->getMessage() .’}}’;

secure:
$data = array(‘error’=> array(‘text’=>$e->getMessage()));
echo json_encode($data);
----------
bad:
echo ‘{“wine”: ‘ . json_encode($wines) . ‘}’;

better:
$data = array(‘wine’ => $wines);
echo json_encode($data);
----------

So these changes reflect this.