Created index to start testing on the server, rather than the PHPUnit tests to ensure API call is working.
Fixed a stupid mistake of varible delcaration and scope...D'OH!