Your best bet will be to flash the car car with a file designed to work with a JB4 I.e the back end flash. There are various free backend flash's available from BMS. There are two widely accepted ways of flashing a backend. Firstly using the Bavaria tech cable and the Bimmerboost Windows app. Or you could use an Inpa cable and the android Mhd app with the later option being the more cost effective route.
I'd highly recommend you flashing your car back to stock, then adding the above combination of a BEF + Jb4
The pro's is that the jb4 will act as just a boost controller with all the built in safety parameters, logging, diagnostics etc. The BEF will deal with everything else