Refactor parsePageAPI to common parser, add null/empty check for source