updated API and fixed redirect after signin