JQuery methods to connect to an API