sshall, bracket, ...

Fixed closing bracket in php script
Reformatted code a bit for better visibility, in particular for JSON querries