Can i still diet when pregnant?

To

I have judt found out i am pregnant. About 3-4 weeks along.

I am 214lbs (96kg) and 5 ft 5. I am overweight.

I had been starting to eat healthier, lower my calories from 2300 a day to 1500 calories a day and exercising on the elliptical 30 minutes a day. I am really unfit so my heart rate hits 160 and im shaking afterwards.

I am classed as obese. I want to try and lose weight or maintain weight throughout my pregnancy but is it possible or safe?

If i was in a healthy weight range i would just relax but i am so fat i worry about my health. If anyone can advise me on what to do that would be great. My bmi is something like 34