Refactored /api/messages endpoint

All /api/messages requests are now GET requests, rather than POST.  That should've been caught by me in code review, so that was partially my bad in the first place.  

I also corrected some issues in the handling of UNIX timestamps (added a function to do the conversion).