When any relative or friend of a lunatic detained in any asylum under the provisions of sections 14,15 or 17 is desirous that such lunatic shall be delivered over to his care and custody, he may make application to the authority under whose order the lunatic is detained, and such authority, if it thinks fit, in consultation with the person in c...