fixed labels.json update on directory creation
moved directory initialization in a function
fixed init_directory
added page creation