add functions to frontend.