Removed redundant code in serial_api