implemented API call for auth