split up endpoint into 4 scripts