Server script now returns valid json.

Can now use this script for other purposes (e.g., ios application).