Small changes to ajax functionality and index output