Fix retval of endpoint