bunch of database stuff
add ajax call for show action