finish most functionalities for front-end