Fix incorrect epoch conversion
Separate api related test cases into another file