"The family is sleeping in a bed."
Translation:Die Familie schläft in einem Bett.
German is very preposition-rich, so I don't think anyone would say "sleep in the bed" (im Bett) in german, but rather "sleep on the bed" (auf dem Bett). But I might be wrong.
"Die Familie schlaeft in einem Bett" sounds normal and natural; "Die Familie schlaeft auf einem Bett" would sound very odd.
No, that only works with the definite article:
in einem (in a)
in dem/im (in the)
In songs like Bilder im Kopf by Sido they contract einem to nem, though I don't understand the rules for that or think thatDuo will accept it.