backend code for PLATE