JavaFX and communication with backend