I can't find what is wrong. I use getJSON:
$.getJSON(api,
{
Content-Type : 'application/json'
}).done(function( data )
{
$(data).each(function(key,val){
console.log(val.calories)
});
}).fail( function(xhr, textStatus, errorThrown) {
alert(xhr.responseText);
});
and console returns me:
SyntaxError: missing : after property id
pointing to line
Content-Type : 'application/json'