Some more changes to the ajax db calls