Add REST web service for get personal messages - refs #7338

In a function that is the last step before calling a database method, always filter the parameters. In this case, give a default setting of = 0 to $lastId (because during the very first call it's not necessarily given), then check that $userId and $lastId are intval() (otherwise return 0)