add util function for JSON posts
move time functions to new module