add nil check to get user by username api call