add ajax polling and some todos