function api_response(response) {
if (
response.data) {
response.data.forEach(function (item) {
if (item.method == 'append') {
$(item.selector).append(item.content);
}
else if (item.method == 'show') {
$(item.selector).show();
}
else if (item.method == 'hide') {
$(item.selector).hide();
}
else if (item.method == 'remove') {
$(item.selector).remove();
}
else if (item.method == 'html') {
$(item.selector).html(item.content);
}