Lots of fixes to make signalr callback function