apns: add doc comments
add tests