refactored api.test.js to be a bit more readable
test nonce/timestamp verification.