Added callback to endpoint to prevent origin errors