Changed onMessage and onRequest to generic handle