Refactored flash API to have FLASH_SUCCESS return status