added ajax_response to better handle apli responses