Move serialize handling to ApiListener

Allow make ApiListener use the viewVar config from the action when building _serialize