Working code for posting and getting json returned to browser