Cloud code for Pairfit on Parse