Java backend code