added api_count utility method to front_controller