Keep mlRest generic

Remove custom function from mlRest.js
Also fix issue where type of username and dateTime would be null despite values bring set.