tag counts api and improved format code parsing