Calibration of the MAGIC telescope and observation of gamma ray bursts