Getting the information in JSON fromat from the PHP service.

Script re-structuring. There is not unit testing and probably good
practices in this version as  it's just a sample version to test the
calls.