GAPI converted to jquery $.get and $.post