almost there

added AJAX function for users, plus a bunch more abstraction