Post office secures £370m funding from government