Fix issue #12, added multiple api support