ajax for serving status cleaned up code