add parsejson func to interact with angularjs