fix endpoint functions