I don't know if it was my eyes fooling me or if it was real. I've seen birds suddenly get suspended in the air, flapping their wings but not moving. Like making non-locomotor movement on the air. Is there an explanation for this?
Doing a stationary flight is called hovering (as @kmm said in the comments).
With head wind
When there is a (relatively important) head wind, many birds are able to perform stationary flights. However, in the bird's referential the flight is not stationary. It is typically common to see that for see birds.
In absence of head wind, most birds aren't able to hover. There are a few exceptions. Hummingbirds hover while feeding on nectar. Some birds of prey are able to hover (they do so for hunting purposes) such as the common kestrel for example. While fishing, the pied kingfisher is famous for its hovering behaviour.
Anatomy and metabolic cost
Generally speaking, hovering requires flapping its wings very fast and is therefore energetically very costly. From wikipedia
Most birds that hover have high aspect ratio wings that are suited to low speed flying. One major exception to this are the hummingbirds, which are the most accomplished hoverers of all the birds. Hummingbird flight is different from other bird flight in that the wing is extended throughout the whole stroke, the stroke being a symmetrical figure of eight, with the wing producing lift on both the up- and down-stroke. Some hummingbirds can beat their wings 52 times a second, though others do so less frequently.
Here are some videos of birds hovering: