AJAX for RESTful behaviour