prime function in my api