adding api endpoint funct