update to accept ajax requests