Fix DB access, add AJAX because it is cool