make a new directory when it doesn't exist & trying to make generate an ajax call