endpoint will now be set via function call