We present two-epoch, multifrequency complete modeling of Mrk 501 broad band emission from the radio frequencies up to the very high gamma ray regime as observed during April 1997 outburst. To reproduce the X-ray and the gamma-ray radiation we assume an homogeneous Synchrotron-Self-Compton (SSC) model and approximate the electrons energy distribution by a broken power-law function with a sharp cut-off at high energy. We assume also spherical geometry of the emitting region (a blob) and uniform magnetic field. For this scenario we derive constrains on physical parameters obtained from the observable quantities and can reproduce very well the observed Very High Energy (VHE) spectra. We find that the two different high energy states cannot be explained by varying the particle energy distribution only. To obtain good spectral fits we have to change additionally one of the global parameters which describe the emitting blob: the magnetic field intensity (B), the radius (R_b) or the Doppler factor (delta_b ). We use a model of an inhomogeneous conical jet to explain radiation from the low radio frequencies up to the ultraviolet. A part of the physical parameters of this jet can be constrained from our fits of the high energy emission. The remaining parameters are estimated independently from other observations. We assume that the blob is placed somewhere inside the jet, relatively close to the central engine. Within this ``blob-in-jet" scenario we analyze the effect of External Inverse-Compton (EIC) scattering of low energy synchrotron photons from the jet and thermal radiation surrounding the central engine. We show that EIC scattering can also very well explain VHE emission of Mrk 501 when external radiation is dominated by photons from the jet itself, which is an interesting alternative of the ``blob-in-jet" scenario. Additional inverse-Compton scattering of relatively weak thermal external radiation cannot explain alone the spectra but can significantly modify them, especially in the sub-TeV range, in comparison to spectral shape generated only with SSC model. We also analyze the absorption effect due to pair-production inside the source, which appears almost negligible. The same effect in the Intergalactic Infrared Background (IIB) may introduce significant changes to the observed VHE spectra. In the infrared and optical parts of the spectrum, the contribution of the host galaxy is well reproduced by an elliptical galaxy evolution model. Three miniflares of Mrk 501 occurred in ten days between 7 and 16 April 1997 at the X-ray and gamma-ray frequencies. They can be well reproduced by simple variation of the break in the electron energy distribution function on time scale of a few hours, superposed to variation of the blob radius and of the particle density on time scale of about two days.