Update Endpoint.php

See #132 "Serialization of 'Closure' is not allowed" on Google/Facebook cancel.